<?php

class Form_CompanyForm extends Form_Custom_General {

    public function init() {
        
        $com_id = $this->createElement('hidden', 'com_id')
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60"));
        $this->addElement($com_id);
        
        
        
        $com_name = $this->createElement('text', 'com_name')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_name"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_name")));
        $this->addElement($com_name);
        
       
        $com_phone = $this->createElement('text', 'com_phone')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_phone"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_phone")));
        $this->addElement($com_phone);
        
        
       
        $com_fax = $this->createElement('text', 'com_fax')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_fax")));
        $this->addElement($com_fax);
        

        $com_address= $this->createElement('textarea', 'com_address')
                    ->setRequired(TRUE)
                    ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_address"))))
                    ->addFilters(array(
                        new Zend_Filter_StringTrim()
                    ))
                    ->setAttribs(Array("size" => "60", "cols" => "50", "rows" => "3","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_address")));
        $this->addElement($com_address);
        
        $com_city= $this->createElement('text', 'com_city')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_city"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim()
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_city")));
        $this->addElement($com_city);

        

         $com_state = $this->createElement('text', 'com_state')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_state"))))
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_state")));
        $this->addElement($com_state);
        
        $com_country = $this->createElement('select', 'com_country')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))  
                ->setAttribs(Array( "class" => "select2"))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_country"))));
        $this->addElement($com_country);
         
        $com_zipcode = $this->createElement('text', 'com_zipcode')
                #->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array("size" => "60","class"=>"span6","placeholder"=>$this->translateObj->translate("company_frm_zip")));
        $this->addElement($com_zipcode);
        
        $com_type = $this->createElement('select', 'com_type')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_type"))));
        $this->addElement($com_type);    

        

         $com_status = $this->createElement('select', 'com_status')
                ->setRequired(TRUE)
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => $this->translateObj->translate("company_required_status"))));
        $this->addElement($com_status); 
        
      
        
        
       


        $submit = $this->createElement('submit','Save')
                ->setAttribs(Array('title' => "Save changes", 'class'=>"btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_save"));
        $this->addElement($submit);


        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class'=>"btn-glow primary"))
                 ->setLabel($this->translateObj->translate("frm_reset"));
        $this->addElement($reset);
    }

}